package com.tfd.blog.utlis;

import lombok.Data;

/**
 * @author TangFD@HF 2019/5/8
 */
@Data
public class JsonResult<T> {
    private String message;
    private T data;
    private boolean success = true;

    public JsonResult() {
    }

    public JsonResult(String message) {
        this(message, true);
    }

    public JsonResult(String message, boolean success) {
        this(message, null, success);
    }

    public JsonResult(String message, T data, boolean success) {
        this.message = message;
        this.data = data;
        this.success = success;
    }

    public JsonResult(T data) {
        this(null, data, true);
    }

    public void setMessage(String message, boolean success) {
        this.message = message;
        this.success = success;
    }
}
